//
//  LSZAudioManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/25.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZAudioManager.h"

@implementation LSZAudioManager
-(id)initWithAudioManager:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        NSMutableArray * arrayMut = [NSMutableArray array];
        self.mutDataArray = [NSMutableArray array];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        for (NSDictionary * dicDta in arrayData) {
            LSZAudioMg * audioMg = [[LSZAudioMg alloc]init];
            audioMg.id_id = NullStringjudgment(NSStr(dicDta[@"id"]));
            audioMg.image = NullStringjudgment(NSStr(dicDta[@"image"]));
            audioMg.singerName = NullStringjudgment(NSStr(dicDta[@"singerName"]));
            audioMg.total_song = NullStringjudgment(NSStr(dicDta[@"total_song"]));
            if ([dicDta valueForKey:@"content"]) {
                audioMg.content = NullStringjudgment(NSStr(dicDta[@"content"]));
            }
            if ([dicDta valueForKey:@"type"]) {
                audioMg.type = NullStringjudgment(NSStr(dicDta[@"type"]));
            }
            if ([dicDta valueForKey:@"total_album"]) {
                audioMg.total_album = NullStringjudgment(NSStr(dicDta[@"total_album"]));
            }
            if ([dicDta valueForKey:@"likes"]) {
                audioMg.likes = NullStringjudgment(NSStr(dicDta[@"likes"]));
            }
            if ([dicDta valueForKey:@"hits"]) {
                audioMg.originalHits = NullStringjudgment(NSStr(dicDta[@"hits"]));
                audioMg.hits  = [LSZSpecialPackaging theNumberViewsForTheAlbumAhanges:audioMg.originalHits];
            }
            if ([[dicDta allKeys] containsObject:@"album_name"]) {
                audioMg.album_name = NullStringjudgment(NSStr(dicDta[@"album_name"]));
            }
            if ([[dicDta allKeys] containsObject:@"artist_name"]) {
                audioMg.artist_name = NullStringjudgment(NSStr(dicDta[@"artist_name"]));
            }
            [arrayMut addObject:audioMg];
        }
        self.mutDataArray = arrayMut;
    }
    return self;
}
@end
@implementation LSZAudioMg

@end
